
<section class="vbox">

    <section class="scrollable padder">

        <div class="m-b-md">
            <h3 class="m-b-none"></h3>
        </div>


        <section class="panel panel-default">
            <header class="panel-heading h5">
                添加管理员
            </header>
            <div class="panel-body">
                <form class="form-horizontal form-validate" method="post" action="<?php echo \Yii::$app->urlManager->createUrl("user/doadd"); ?>">


                    <div class="form-group">
                        <label class="col-sm-2 control-label">用户名：</label>
                        <div class="col-sm-4 controls">
                            <input type="text" class="form-control"  name="username" data-rule-required="true" value="" data-rule-remote="<?php echo \Yii::$app->urlManager->createUrl("user/checkname"); ?>">
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">密码：</label>
                        <div class="col-sm-4 controls">
                            <input type="password" class="form-control"  name="password" id="password" data-rule-required="true" value="" >
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">确认密码：</label>
                        <div class="col-sm-4 controls">
                            <input type="password" class="form-control"  name="confirm_passwd" data-rule-equalTo="#password" data-rule-required="true" value="" >
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">真实姓名：</label>
                        <div class="col-sm-4 controls">
                            <input type="text" class="form-control"  name="nick" data-rule-required="true" value="" >
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">权限：</label>
                        <div class="col-sm-6 controls">
                            <select name="role_id" class="form-control m-b" data-rule-required="true">
                                <option>请选择权限</option>
                                <?php foreach($role as $key=>$info):?>
                                    <?php if($info['status'] == 0){?>
                                        <option value="<?php echo $info['id'];?>" disabled><?php echo $info['name'];?>[已禁用]</option>
                                    <?php } else {?>
                                        <option value="<?php echo $info['id'];?>"><?php echo $info['name'];?></option>
                                    <?php }?>
                                <?php endforeach;?>
                            </select>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">状态：</label>
                        <div class="col-sm-10">
                            <label class="checkbox-inline i-checks">
                                <input type="radio" value="1" name="status" checked="checked"><i></i> 启用
                            </label>
                            <label class="checkbox-inline i-checks">
                                <input type="radio" value="0" name="status"><i></i> 停用
                            </label>

                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <div class="form-group">
                        <div class="col-sm-4 col-sm-offset-2">
                            <button type="reset" class="btn btn-default">重置</button>
                            <button type="submit" class="btn btn-primary">保存</button>
                        </div>
                    </div>
                </form>
            </div>
        </section>
    </section>
</section>